import React from 'react'
// @ts-ignore
import styles from './index.less'
// @ts-ignore
import PerfectScrollbar from "react-perfect-scrollbar";
// @ts-ignore
import {Drawer} from "antd";

interface EditContentProps {
  visible:boolean,
  width?: number,
  title: React.ReactNode,
  footer?: React.ReactNode,
  extra?: React.ReactNode,
  onClose: () => void,
  placement?: "top"|"right"|"bottom"|"left",
}

const EditContent: React.FC<EditContentProps> = ({ title, footer, visible,children,width,onClose, placement}) => {

  return <Drawer
    width={width||640}
    placement={placement||'right'}
    closable={true}
    onClose={onClose}
    visible={visible}
    title={title}
    bodyStyle={{padding:0}}
    footer={footer??null}
  >
    <PerfectScrollbar className={styles.panel}>
      {children}
    </PerfectScrollbar>
  </Drawer>
};


export default EditContent;
